﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using StockTrader.DAL.HoseAdapter.FileParser.Structure;

namespace StockTrader.DAL.IDAL
{
    public interface ISecurities
    {
        void BeginADOTransaction();
        void RollBackTransaction();
        void CommitADOTransaction();
        void Open(string connString);
        void Close();

        #region Hose PRS

        void InsertDeList(int stockNo, string symbol, string stockType, string stockName, int sectorNo);
        int CountDeList();
        void DeleteDeList();

        void InsertFroomOrigin(long stockNo,  double totalRoom, double currentRoom);
        int CountFroomOrigin();
        void DeleteFroomOrigin();

        void DeleteFroom();
        void UpdateFroom(long stockNo, double totalRoom, double currentRoom, int buy, int sell);
        //List<Froom> getFroom();

        void InsertLe(long stockNo, long price, long accumulateVol, double accumulateVal, long highest, long lowest, long time);
        int CountLe();
        void DeleteLe();
        void InsertLeCompact(int stockno, int price, int volume, int volp1, int valp1, int volp2, int valp2, int time);

        void InsertMarketStat(string controlCode, long time);
        int CountMarketStat();
        void DeleteMarketStat();

        void InsertNewList(int stockNo, string symbol, string stockType, string stockName, int sectorNo);
        int CountNewList();
        void DeleteNewList();

        void InsertPutAd(int tradeid, int stockid, long vol, double price, long firmno, string side, string board, long time, string flag);
        int CountPutAd();
        void DeletePutAd();

        void InsertPutDc(int confirmNo, int stockId, long vol, long price, string board);
        int CountPutDc();
        void DeletePutDc();

        void InsertPutExec(long confirmNo, int stockId, long vol, long price, string board);
        int CountPutExec();
        void DeletePutExec();

        void InsertSecurities(int stockNo, string symbol, string stockType, long ceiling, long floor, double bigLotValue, string securitiesName, string sectorNo, string designated, string suspension, string delist, string haltResumeFlag, string split, string benefit, string meeting, string notice, string clientIdRequest, int couponRate, string issueDate, string matureDate, long avrPrice, int parValue, string SDCFlag, long PriorClosePrice, string priorCloseDate, long projectOpen, long openPrice, long last, long lastVol, double lastVal, long highest, long lowest, double totalShare, double totalValue, int AccumulateDeal, int bigDeal, long bigVol, double bigVal, long oddVol, double oddVal, long best3Bid, long best3BidVolume, long best2Bid, long best2BidVolume, long best1Bid, long best1BidVolume, long best1Offer, long best1OfferVolume, long best2Offer, long best2OfferVolume, long best3Offer, long best3OfferVolume, int boardLost);
        int CountSecurities();
        void DeleteSecurities();
        void UpdateSecuritiesByStockSymbol(string designated, string suspension, string delist, string haltResumeFlag, string split, string benefit, string meeting, string notice, string clientIdRequest, int couponRate, string issueDate, string matureDate, long avrPrice, int parValue, string SDCFlag, long projectOpen, long last, long lastVol, double lastVal, long highest, long lowest, double totalShare, double totalValue, int AccumulateDeal, int bigDeal, long bigVol, double bigVal, long oddVol, double oddVal, long best3Bid, long best3BidVolume, long best2Bid, long best2BidVolume, long best1Bid, long best1BidVolume, long best1Offer, long best1OfferVolume, long best2Offer, long best2OfferVolume, long best3Offer, long best3OfferVolume, int boardLost, long openPrice, string symbol);

        void InsertTotalMkt(long vnIndex, long totalTrade, double totalShares, double totalVlues, double upVolume, double noChangeVolume, double downVolume, int advances, int declines, int noChange, long vn50index, string marketid, string filter, long time);
        int CountTotalMkt();
        void DeleteTotalMkt();

        void UpdateSecuritiesEarly(int stockNo, string symbol, string stockType, long ceiling, long floor, double bigLotValue, string securitiesName, string sectorNo, string designated, string suspension, string delist, string haltResumeFlag, string split, string benefit, string meeting, string notice, string clientIdRequest, int couponRate, string issueDate, string matureDate, long avrPrice, int parValue, string SDCFlag, long PriorClosePrice, string priorCloseDate, long projectOpen, long openPrice, long last, long lastVol, double lastVal, long highest, long lowest, double totalShare, double totalValue, int AccumulateDeal, int bigDeal, long bigVol, double bigVal, long oddVol, double oddVal, long best3Bid, long best3BidVolume, long best2Bid, long best2BidVolume, long best1Bid, long best1BidVolume, long best1Offer, long best1OfferVolume, long best2Offer, long best2OfferVolume, long best3Offer, long best3OfferVolume, int boardLost);

        void UpdateSecuritiesLately(int stockNo, string symbol, string stockType, long ceiling, long floor, double bigLotValue, string securitiesName, string sectorNo, string designated, string suspension, string delist, string haltResumeFlag, string split, string benefit, string meeting, string notice, string clientIdRequest, int couponRate, string issueDate, string matureDate, long avrPrice, int parValue, string SDCFlag, long PriorClosePrice, string priorCloseDate, long projectOpen, long openPrice, long last, long lastVol, double lastVal, long highest, long lowest, double totalShare, double totalValue, int AccumulateDeal, int bigDeal, long bigVol, double bigVal, long oddVol, double oddVal, long best3Bid, long best3BidVolume, long best2Bid, long best2BidVolume, long best1Bid, long best1BidVolume, long best1Offer, long best1OfferVolume, long best2Offer, long best2OfferVolume, long best3Offer, long best3OfferVolume, int boardLost);
        #endregion

        string getSecuritiesNameBySymbol(string symbol);
        List<string> getSecuritiesSymbol();
        int CountBackupSecurities(DateTime transDate);

        void Clear();
        void UpdateATOByStockNo(int stockNo, DateTime transDate);
        void UpdateATCByStockNo(int stockNo, DateTime transDate);
        void UpdateSession2ByStockNo(int stockNo, DateTime transDate);
        void InitSessionData(DateTime transDate);

//         List<ProData> getFullInfo();
    }
}
